Static parameters could be defined into an action through xwork.xml like bellow: <action name="myAction" class=" ... "> <param name="myStaticParam1">myStaticValue1</param> <param name="myStaticParam2">myStaticValue2</param> <param name="myStaticParam3">myStaticValue3</param> </action> + Method A +
+ Method B + public class MyAction extends ActionSupport { ... public String getMyStaticParam1() { ....} public void setMyStaticParam1(String myStaticParam1) { ... } public String getMyStaticParam2() { ... } public void setMyStaticParam2(String myStaticParam2) { ... } public String getMyStaticParam3() { ... } public void setMyStaticParam3(String myStaticParam3) { ... } ... } The getter and setter, will be set appropriately. NOTE: For this to work, 'static-params' interceptor must be added to the action. @see com.opensymphony.xwork.interceptor.StaticParametersInterceptor |